package com.easylinkin.linkappapi.quality.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.quality.dto.QualityInspectionDTO;
import com.easylinkin.linkappapi.quality.entity.QualityInspection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 巡检记录 Mapper 接口
 * </p>
 *
 * @author kanyuanfeng
 * @since 2022-08-15
 */
public interface QualityInspectionMapper extends BaseMapper<QualityInspection> {

  IPage<QualityInspectionDTO> queryListByPage(Page page,@Param("qualityInspectionDTO") QualityInspectionDTO qualityInspectionDTO);

  QualityInspectionDTO findById(Integer id);

  /**
   * 根据租户状态分组统计数量
   * @param tenantIds 租户ids
   * @return 统计数据
   */
    List<Map<String, Object>> countByTenantStatue(@Param("tenantIds") List<String> tenantIds);
}
